#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
typedef double db;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') { if(ch=='-')f=-1; ch=getchar(); }
	while(ch>='0'&&ch<='9') { x=(x<<1)+(x<<3)+ch-'0'; ch=getchar(); }
	return x*f;
}
const int MAXN=1010,MOD=1e9+7;
int n,m,a[MAXN],f[MAXN],C[MAXN<<1][MAXN<<1],ans;
int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	n=read();m=read();
	for(int i=1;i<=m;++i)a[i]=read();
	for(int i=0;i<=n+n;++i)
	{
		C[i][0]=1;
		for(int j=1;j<=i;++j)
			C[i][j]=(C[i-1][j]+C[i-1][j-1])%MOD;
	}
	for(int i=1;i<=n;++i)
	{
		f[i]=1;
		for(int j=1;j<=m;++j)
			f[i]=(LL)f[i]*C[a[j]+i-1][i-1]%MOD;
	}
	for(int i=0;i<n;++i)ans=(ans+((i&1)?-1:1)*(LL)C[n][i]%MOD*f[n-i]%MOD+MOD)%MOD;
	printf("%d\n",ans);
	return 0;
}
